import request from '@/utils/request.js'

export const getCateListAPI = () => {
  return request.get('/my/cate/list')
}
export const addCateAPI = (obj) => {
  return request.post('/my/cate/add', obj)
}
export const delCateAPI = (id) => {
  return request.delete('/my/cate/del', {
    params: { id }
  })
}
export const editCateAPI = (obj) => {
  return request.put('/my/cate/info', obj)
}
export const pubArcitleAPI = fd => request.post('/my/article/add', fd)
// 获取文章列表数据接口
// export const getArtListAPI = (q) => {
//   return request.get('/my/article/list', {
//     params: { q }
//   })
// }
export const getArtListAPI = (q) => {
  return request.get('/my/article/list', {
    // params: { q }
    // params: {
    //   参数1: 值1,
    //   参数2: 值2
    // }
    params: q
  })
}
// 调用文章详情接口
export const getArticleAPI = id => request.get('/my/article/info', { params: { id } })
// 删除文章接口
export const delArticleAPI = id => request.delete('/my/article/info', { params: { id } })
